
#ifndef THREAD_H_
#define THREAD_H_

/*
*       Thread data structure
*       Authors: danithelion and wilfoa
*/

#include "uthreads.h"
#include <sys/time.h>
#include <setjmp.h>

typedef enum STATE {
	RUNNING,READY,SUSPENDED,SLEEPING
} State;

typedef struct Thread{
	unsigned int _id;
	int _priority;
	unsigned int _readyTimeStamp;
	sigjmp_buf _env;
	State _currentState;
	char _stack[10000];
} Thread;

//Allocates space for the  thread and returns a pointer to it. The fuctions sets the values sent to it inside
//the Thread instance
//Responsibility for freeing space is upon the caller of the function
Thread* initThread(unsigned int id,int priority);

#endif /* THREAD_H_ */
